import { request_index_swiper } from "../../request/index.js"

Page({

  /**
   * 页面的初始数据
   */
  data: {
    //轮播图数组
    swiperList: [],
    //导航数组
    CateList:[],
    floorList:[]
  },

  //  页面开始加载，就会触发
  onLoad: function (options) {
    //  wx.request({
    //    url: 'https://api.zbztb.cn/api/public/v1/home/swiperdata',      
    //    success: (result) => {
    //     this.setData({
    //       swiperList:result.data.message
    //     }); 
    //    } 
    //  })
    this.GetSwiperList();
    this.GetCateList();
    this.GetfloorList();

  },
  //获取轮播图数据
  GetSwiperList() {
    request_index_swiper({ url: "https://api.zbztb.cn/api/public/v1/home/swiperdata" })
      .then(result => {
        this.setData({
          swiperList: result.data.message
        });
      })
  },
   //获取分类数据
   GetCateList() {
    request_index_swiper({ url: "https://api.zbztb.cn/api/public/v1/home/catitems" })
      .then(result => {
        this.setData({
          CateList: result.data.message
        });
      })
  },
 //获取楼层
 GetfloorList() {
  request_index_swiper({ url: "https://api.zbztb.cn/api/public/v1/home/floordata" })
    .then(result => {
      this.setData({
        floorList: result.data.message
      });
    })
},


  
})